home *** CD-ROM | disk | FTP | other *** search
- /* look at this, check for nil? */
-
- /* Globals.c */ /* C14 Calculator */
- #include "Globals.h"
- /*#include "PredatorPrey.h"*/
-
- /*Standard vars:*/
-
- Boolean quittingTime;
- short kkk;
- EventRecord curEvent;
- WindowPtr curWindow;
- WindowPtr altCurWindow;
- WinInfoPtr cur;
- WinInfoPtr altCur;
- SysConfigRec sysConfig;
- WinInfoRec noCur;
- Rect viewRect; /* for calculations of TE areas */
- Point workPoint; /* work variable */
- short myMouseWhere; /* location (not Point) of mouse */
- Boolean workBoolean; /* work variable */
- short WorkRetCode; /* work return code */
- WindowPtr workWindowPtr; /* pointer from FindWindow */
- long worklong; /* work variable */
- RgnHandle workRegionH; /* work handle for TE redraw */
- Rect destRect; /* for calculations of TE areas */
- short windSub; /* subscript for window table */
- Point helpCell = {0, 0}; /* cell for List Manager */
- short helpPrev = -1; /* previously selected help item */
- Rect workRect; /* work variable */
-
- void GlobalsSeg() {}
-
- /*----------*/
- void InitGlobals (void)
- {
- curWindow = nil;
-
- noCur.text = nil;
- noCur.vScroll = nil;
- noCur.hScroll = nil;
- noCur.pFileNum = 0;
- noCur.qFileNum = 0;
- noCur.volNum = 0;
- noCur.pDirty = false;
- noCur.qDirty = false;
- noCur.windowKind = noWindow;
- //noCur.rText = nil;
-
- cur = &noCur;
-
- } /*InitGlobals*/
-
- /*----------*/
- void SetInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- if (window != curWindow) {
- curWindow = window;
- if (curWindow != nil) {
- infoPtr = (WinInfoPtr) GetWRefCon (curWindow);
- cur = infoPtr;
- } else {
- cur = &noCur;
- }
- }
- } /*SetInfo*/
-
- /*void SetSaveInfo (WindowPtr window)*/
- /*{*/
- /* WinInfoPtr infoPtr;*/
- /**/
- /* if (window != altCurWindow) {*/
- /* altCurWindow = window;*/
- /* if (altCurWindow != nil) {*/
- /* infoPtr = (WinInfoPtr) GetWRefCon (curWindow);*/
- /* altCur = infoPtr;*/
- /* } else {*/
- /* altCur = &noCur;*/
- /* }*/
- /* }*/
- /*} /*SetSaveInfo»*/
-
- /*----------*/
- void SetNewInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- infoPtr = (WinInfoPtr) NewPtr (sizeof (WinInfoRec));/* look at this, check for nil? */
- SetWRefCon (window, (long) infoPtr);
- SetInfo (window);
- } /*SetNewInfo*/
-
- /*----------*/
- /*void SetAltInfo (WindowPtr window)*/
- /*{*/
- /* WinInfoPtr infoPtr;*/
- /* */
- /* infoPtr = (WinInfoPtr) NewPtr (sizeof (WinInfoRec));*/
- /* SetWRefCon (window, (long) infoPtr);*/
- /* SetSaveInfo(window);*/
- /*} /*SetAltInfo*/
-
- /*----------*/
- void DiscardInfo (WindowPtr window)
- {
- WinInfoPtr infoPtr;
-
- if (window == curWindow) {
- SetInfo (nil);
- }
- infoPtr = (WinInfoPtr) GetWRefCon (window);
- DisposPtr ((Ptr) infoPtr);
- HideWindow (window);
- DisposeWindow (window);
- } /*DiscardInfo*/
-
- /* Globals */
-